<?php 
  require_once('Admin/Common/template/inc_admin.php');
 ?>
    
     <div id="content">
   <div class="inner" style="min-height:1200px;">
     
s
<div align=center>
			<h1 style="text-align:center">
				修改用户资料</h1>	
				 <?php
   
   $row = $data['user'];
   //var_dump($row); 
   $id = $row['uid'];  
   $uname = $row['uname'];
   $gender = $row['gender'];
   $birthdate = $row['birthdate'];
   $hobby = $row['hobby'];
   $degree = $row['degree'];
   $intro = $row['intro'];
   $pic = './upload/'.$row['pic']; 
   //var_dump($row);
	//将查询结果显示在表单中
 ?>
	<div class="container-fluid">
 <form method="post" action="admin.php?c=user&m=update" enctype="multipart/form-data" class="form-horizontal">
    <input type="hidden" name="id"  value=<?php echo $id;?>>
 <div class="form-group">
    <label for="exampleInputUserName1" class=" control-label col-sm-offset-2 col-md-2 ">姓名：</label>
    <div class=" col-md-4" >
    <input type="text" name="uname" class="form-control" id="exampleInputUserName1" value=<?php echo $uname; ?>>
    </div>  
  </div>
  <div class="form-group">
    <label class="col-md-2 col-sm-offset-2 control-label" >性别：</label>
    <div class="col-md-4" >
    <label class="radio-inline">
    <input type="radio" name="gender" value="0" <?php  if(!$gender) echo 'checked'; ?>>男
    </label>
    <label class="radio-inline">
    <input type="radio" name="gender" value="1" <?php  if($gender) echo 'checked'; ?>>女
    </label>
    </div>  
  </div>
  <div class="form-group">
    <label for="exampleInputDate1" class="col-md-2 col-sm-offset-2 control-label" >生日：</label>
    <div class="col-md-4" >
    <input type="date" name="birthdate" class="form-control" id="exampleInputDate1" value=<?php echo $birthdate; ?>>
    </div>  
  </div> 
 <div class="form-group">
    <label class="col-md-2 col-sm-offset-2 control-label">爱好：</label>
    <div class="col-md-4">
    <label class="checkbox-inline">
    <input type="checkbox" name="hobby[]" value="旅游" <?php if(strstr($hobby,'旅游')) echo 'checked'; ?>>旅游
    </label>
    <label class="checkbox-inline">
    <input type="checkbox" name="hobby[]" value="登山" <?php if(strstr($hobby,'登山')) echo 'checked'; ?>>登山
    </label>
    <label class="checkbox-inline">
    <input type="checkbox" name="hobby[]" value="健身" <?php if(strstr($hobby,'健身')) echo 'checked'; ?>>健身
    </label>
    <label class="checkbox-inline">
    <input type="checkbox" name="hobby[]" value="上网" <?php if(strstr($hobby,'上网')) echo 'checked'; ?>>上网
    </label>
    <label class="checkbox-inline">
    <input type="checkbox" name="hobby[]" value="游泳" <?php if(strstr($hobby,'游泳')) echo 'checked'; ?>>游泳
    </label>
    </div>  
  </div> 
  <div class="form-group">
    <label class="col-md-2 col-sm-offset-2 control-label" >学历：</label>
    <div class="col-md-4" >
    <select class="form-control" name="degree">
    <option value="0" >请选择</option>
    <option value="1" <?php if ($degree=='1')  echo 'selected'; ?>>高中</option>
    <option value="2" <?php if ($degree=='2')  echo 'selected'; ?>>大学</option>
    <option value="3" <?php if ($degree=='3')  echo 'selected'; ?>>研究生</option>
    <option value="4" <?php if ($degree=='4')  echo 'selected'; ?>>博士生</option>
    </select>
    </div>  
  </div>
  <div class="form-group">
    <label for="exampleInputTextarea1" class="col-md-2 col-sm-offset-2 control-label">自我介绍：</label>
    <div class="col-md-4" >
    <textarea class="form-control" id="exampleInputTextarea1" name="intro" cols="40" rows="5"><?php echo $intro; ?></textarea>
    </div>  
  </div>
  <div class="form-group">
    <label for="exampleInputFile" class="col-md-2 col-sm-offset-2 control-label">头像：</label>
    <div class="col-md-4" >
    <input type="file" name="pic" id="exampleInputFile">原头像：<img src="<?php  echo $pic; ?>" width="80px" height="80px" class="img-circle">
    </div>  
  </div>
  <div class="form-group">
    <div class="col-sm-offset-7 col-sm-4" >
    <input type="submit" class="btn btn-success" value="更新">
    </div>  
  </div>
</form>
</div>
  </div>
    </div>      
</div>  
